﻿
''' <summary>
''' Gives details about a how an argument is used on a token
''' </summary>
''' <remarks></remarks>
<Serializable()>
Public Class ArgumentDefinition
    ''' <summary>
    ''' The name of the argument
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property Name As String = ""

    ''' <summary>
    ''' The data type of the argument
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property [Type] As ArgType

    ''' <summary>
    ''' A textual description of what the argument means
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property Description As String = ""

    ''' <summary>
    ''' Data used by the handler for this argument type tovalidate and act as a list source for data
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property TypeData As String = ""

    ''' <summary>
    ''' The index of this argument within the token
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property Index As Integer

    ''' <summary>
    ''' Generates a formatted description for the argument
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetArgumentHtmlString() As String
        Dim ret As String = "     <b>" & Me.Name & "</b> : <i>" & Type.ToString & "</i>"
        If Me.Description <> "" Then
            ret &= " : " & Description
        End If

        Return ret
    End Function

End Class
